import axios from "@/utils/request"
import signMd5Utils from '@/utils/signMd5Utils'

const Api = {
  login: '/admin/login',

}

export function getAction(url,parameter){
    
    return axios({
        url:url,
        method:'get',
        params:parameter
    })
}

export function postAction(url,parameter) {
    let sign = signMd5Utils.getSign(url, parameter);
    //将签名和时间戳，添加在请求接口 Header
    let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getDateTimeToString()};
  
    return axios({
      url: url,
      method:'post' ,
      data: parameter,
      headers: signHeader
    })
  }

export function login(parameter){
    return axios({
      url:Api.login,
      method:'post',
      data:parameter
    })
}